<script type="text/javascript">
	var data = null;
	var count = 0;

	function plot1(index) {
		alert(index);
	}
	
	function plot2(index) {
		confirm(index);
	}
	

	// For AJAX
	function refresh(dataURL) {
		count++;
		var req = null; 

		if (window.XMLHttpRequest) {
			req = new XMLHttpRequest();
			if (req.overrideMimeType) {
				req.overrideMimeType('text/xml');
			}
		} else if (window.ActiveXObject) {
			try {
				req = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e)	{
				try {
					req = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {}
			}
		}

		req.onreadystatechange = function()	{ 
			if(req.readyState == 4)	{
				if(req.status == 200) {
					// Define place to update
					data = req.responseText;
					(navigator.appName.indexOf("Microsoft") == -1)
						? (document["chart_ajax"].load(data))
						: (window["chart_ajax"].load(data));
				} else {
					data = "Error: returned status code " + req.status + " " + req.statusText;
				}
			}
		};
		req.open("get", dataURL, true); 
		req.send(null); 
	}
</script>

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
		codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0"
		width="100%" height="400" id="chart_ajax" align="middle">
	<param name="allowScriptAccess" value="sameDomain"/>

	<param name="movie" value="/flashes/OFC.swf"/>
	<param name="FlashVars" value="data-file=/test"/>
	<param name="quality" value="high"/>
	<param name="bgcolor" value="#FFFFFF"/>
	<embed src="/flashes/OFC.swf" FlashVars="data-file=/test" quality="high" bgcolor="#FFFFFF"
		   width=100% height=400 name="chart_ajax" align="middle" allowScriptAccess="sameDomain"
		   type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/>
</object>

<p>
	<a id="button" href="javascript: refresh('/ajax/' + count);" style="display: inline; margin-right: 300px;">
		Change
	</a>
</p>
<br/>

